package com.ldc.work_1203.mapper;

import com.ldc.work_1203.bean.Company;
import com.ldc.work_1203.bean.Inquire;
import com.ldc.work_1203.bean.Jobinfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface InquireMapper {

    List<Inquire> getListInquire(@Param("studentName") String studentName,@Param("companyName")  String companyName,@Param("miaPay")  Double miaPay,@Param("maxPay")  Double maxPay);

    Integer getInquirecount(@Param("studentName") String studentName,@Param("companyName")  String companyName,@Param("miaPay")  Double miaPay,@Param("maxPay")  Double maxPay);

    @Insert("insert into jobinfo values(0,#{student3Id},#{companyId},#{jobinfoPracticepay},#{jobinfoPositivepay},#{jobinfoPay},#{jobinfoWelfare},now(),#{jobinfoPost},#{jobinfoRemark})")
    void addInquire(Jobinfo jobinfo);

    @Select("select * from jobinfo where jobinfo_id = #{JobinfoId}")
    Jobinfo getJobinfo(Integer JobinfoId);

    @Update("update jobinfo set student3_id = #{student3Id},company_id = #{companyId},jobinfo_practicepay = #{jobinfoPracticepay},jobinfo_positivepay = #{jobinfoPositivepay},jobinfo_pay = #{jobinfoPay},jobinfo_welfare = #{jobinfoWelfare},jobinfo_post = #{jobinfoPost},jobinfo_remark = #{jobinfoRemark} where jobinfo_id = #{jobinfoId} ")
    void upInquire(Jobinfo jobinfo);

    @Delete("delete from jobinfo where jobinfo_id = #{jobinfoId}")
    void delInquire(Integer jobinfoId);
}
